package com.kokomi.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kokomi.pojo.Book;
import com.kokomi.pojo.VO.BookVO;
import com.kokomi.service.BookService;
import com.kokomi.mapper.BookMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author klioe
* @description 针对表【t_book】的数据库操作Service实现
* @createDate 2025-03-27 10:28:15
*/
@Service
public class BookServiceImpl extends ServiceImpl<BookMapper, Book>
    implements BookService{
    @Autowired
    private BookMapper bookMapper;
    public Page<BookVO> getBookByTyId(Integer Tid, Integer pageNum, Integer pageSize){
        Page page = new Page(pageNum, pageSize);
        QueryWrapper<Book> wrapper = new QueryWrapper<>();
        wrapper.eq("type_id",Tid);
        bookMapper.selectPage(page,wrapper);
        return page;
    }

}




